package com.example.medicine.View;


import com.example.medicine.Bean.SystemRole;
import com.example.medicine.Mapper.SystemRoleMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
@Slf4j
@Controller
public class SystemRoleView {
    @Autowired
    private SystemRoleMapper systemroleMapper;
    /**
     * 展示角色信息列表
     */
    @RequiresPermissions("角色管理")
    @RequestMapping("/systemrole")
    public String systemrole(){
        log.info("角色列表页面");
        return "pages/SystemRole/list";
    }
    @RequiresPermissions("角色管理")
    @RequestMapping("/systemrole/create")
    public String systemroleCreateShow(){
        log.info("角色创建页面");
        return "pages/SystemRole/create";
    }
    /**
     * Dlxx编辑展示页面
     */
    @RequiresPermissions("角色管理")
    @RequestMapping("/systemrole/edit/{id}")
    public String getsystemroleById(@PathVariable String id, Model model) {
        log.info("角色编辑页面");
            SystemRole systemrole = systemroleMapper.getById(id);
        systemrole.setID(id);
            model.addAttribute("role", systemrole);
            return "pages/SystemRole/edit";
    }

    }

